
function getNewCapchaName(){
	var xhr = getAjaxObj()
	cmdStr = 'capcha=' + glob_currentCapcha
	cmdStr += '&fuckIE=' + 'IESucks'

	xhr.open('POST', '/getNewCapchaName',  true); 
	xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	xhr.onreadystatechange  = function() { 
		if(AjaxCheck(xhr) == 1) {
			if(xhr.responseText != '0')
			{
				if(document['CapChaIMGID'] == undefined) return
				document['CapChaIMGID'].src = xhr.responseText
				glob_currentCapcha = xhr.responseText
				return
			}
			else{

				return
			}
		}
		else if(AjaxCheck(xhr) == 0) {
			
		}
	}; 

	xhr.send(cmdStr); 
}

function createInput(title, idName){
	html = '<div > ' + title + ':</div>'
	html += '<input type="text" id="' + idName + '" value="" style="width:90%;" /><br><br>'
	return html
}
function createLanguageOptions(){
	html = '<div > Language : '
	html += '<select id="languageChosenID";>'
	for(i in language_list){
		html += '<option>' + language_list[i] + '</option>'
	}
	html += '</select></div><br>'
	return html
}

function createBackButton(){
	html += '<div style="text-align:left;margin-left:10px;margin-top:10px;">'
	html += '<a href="javascript:intialize();">'
	html += 	'<img src="img/goBack.png" width="100px" height="40px">'
	html += '</a>'
	html += '</div><br> '
	return html
}


function drawQuestion(question){

	lnk = '<div style="margin-bottom:20px;margin-left:3%;background:#111111;width:90%;color:#ffffff;box-shadow: 5px 5px 5px #aaaaaa;float:left;border:2px solid;)"><span>' + SafeStringToSpecial(question) + '</span></div>'
	return lnk
}

function drawAnswer(answer, answerUUID, selectedAnswer){

	style = 'style="margin-bottom:30px;margin-left:3%;background:#ffffff;width:90%;color:#000000;box-shadow: 5px 5px 5px #444444;float:left;border:2px solid;)"'

	lnk = '<div ' + style + ' onclick="answerClicked(\'' + specialToSafe(answer) + '\', \'' + answerUUID + '\')">'
	lnk += '<span style="font-size:24px;" >' + SafeStringToSpecial(answer) 
	lnk += '</span></div>'

	return lnk
}

function createCapcha(submitFoo){
	getNewCapchaName()

	html = '<img src="img/dot.png" width="160px" height="55px" name="CapChaIMGID"/><br><br>'
	return html
}

function createUser(userName, points){
	lnk = '<div style="margin-left:10px;text-align:left;width:70%;float:left;border:0px solid;)">' + userName + '</div>'
	lnk += '<div style="margin-left:10px;text-align:left;width:20%;float:right;border:0px solid;">' + points + '</div>'
	return lnk
}

function getOptions(func, img, width, height){
	lnk = '<a href="javascript:' + func + '();">'
	lnk += '<img src="img/' + img + '.png" alt="" width="' + width + 'px" height="' + height + 'px" style="margin-bottom:8px;" /></a>'
	return lnk
}

